<?php
include("class.phpmailer.php");//加载phpmailer主类，一般情况下要设定好phpmailer路径
include("class.smtp.php"); // 加载smtp类，一般情况下要设定好phpmailer路径


	$name = $_POST['name'];
	$course = $_POST['course'];
	$courseNum = $_POST['courseNum'];
	$skype = $_POST['skype'];
	$tel = $_POST['tel'];
	$email = $_POST['email'];
	$startDate = $_POST['startDate'];
	$whybilin = $_POST['whybilin'];
?>

  
<?php
	
	$title = '尊敬的'.  $name .'</strong>,这是您在Bilin的课程预约订单详细信息，请妥善保管。';
	$hi = '<p>尊敬的<strong>'.  $name .'</strong>：<br />您已完成Bilin课程预约，订单号码为：BL0001。以下是订单的详细信息。<br /></p>';
	$table = '<table  border="1" width="485" cellspacing="0" cellpadding="10"><tr><td width="148">选择课程种类:</td><td width="291">'. $course .'&nbsp;</td></tr><tr><td>课程数量，</td><td>'. $courseNum .'&nbsp;</td></tr><tr><td>Skype账户</td><td>'. $skype .'&nbsp;</td></tr><tr><td>电话号码</td><td>'. $tel .'&nbsp;</td></tr><tr><td>邮箱</td><td>'. $email .'&nbsp;</td></tr><tr><td>姓名</td><td>'. $tel .'&nbsp;</td></tr><tr><td>希望开课日期和时间</td><td>'. $startDate .'&nbsp;</td></tr><tr><td>为什么选择Bilin可选）</td><td>'. $whybilin .'&nbsp;</td></tr></table>';
	$contact = '<p>感谢您对Bilin的支持 Bilin<br />Email: <a href="mailto:contactus@bilineducation.com">contactus@bilineducation.com</a><br />电话:  +86-159-2141-3916; +86-136-3664-3173<br />通信地址：上海政立路639弄3号204室</p>';
	
	$body = $hi . $table . $contact ;
	
	
	
	
	
	$mail = new PHPMailer();
	$mail-> IsSMTP(); // 使用(其他就用SMTP)
	$mail->CharSet ="utf8";
	$mail->SMTPSecure = "ssl"; // 设置连接服务器前缀
	$mail->Host = "smtp.gmail.com";      // GMAIL的SMTP
	$mail->Port = 465;                   // GMAIL的SMTP端口号
	$mail->SMTPAuth = true; // 开启SMTP认证
	$mail->Username = "bilineducation2010@gmail.com"; // GMAIL用户名,必须以@gmail结尾
	$mail->Password ="zf05101110"; // GMAIL密码
	//$webmaster_email = "xxx@gmail.com"; //回复到该地址
	$mail->From = "bilineducation2010@gmail.com" ;
	$mail->FromName = "bilineducation";
	
	$mail->AddAddress('bilineducation2010@gmail.com' ,'ddddd');
	
	
	
	$mail->WordWrap = 50;  // 设定 word wrap
	//$mail->AddAttachment("/var/tmp/file.tar.gz"); // 附件1
	//$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // 附件2
	$mail->IsHTML(true); // 以HTML发送
	$mail->Subject = $title ;
	$mail->Body = $body ;
	if(!$mail->Send())
	{
	echo "Mailer Error: " . $mail->ErrorInfo;
	}
	



?>